package dao.jpa;

import java.io.Serializable;
import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import dao.FaturaDAO;
import entity.ContaCredito;
import entity.Fatura;

@Repository
public class FaturaJpaDAO extends GenericJpaDAO<Fatura> implements FaturaDAO,
	Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = 2678582808176831603L;

    @SuppressWarnings("unchecked")
    @Override
    public List<Fatura> listarPorContaCredito(ContaCredito contaCredito) {
	Criteria criteria = criarCriteria();
	criteria.add(Restrictions.eq("contaCredito", contaCredito));
	return criteria.list();
    }
}
